package com.tszs.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.tszs.biz.PersonalAuthorityBiz;
import com.tszs.entity.PersonalAuthority;
import com.tszs.entity.PersonalAuthorityExample;
import com.tszs.util.CallBack;
/**
 * @类名:PersonalAuthorityController
 * @类描述：个人权限 @创建时间：2019-03-22 13:07:07
 * @创建人：王俊
 * @author Administrator
 *
 */
@Controller
public class PersonalAuthorityController {
	/**
	 * PersonalAuthorityBiz
	 * 
	 * @描述: 个人权限表添加
	 * @创建时间:2019-03-21 13:14:14
	 */
	@Autowired
	private PersonalAuthorityBiz personalAuthorityBiz;
	/**
	 * @类名:modifyAuthority
	 * @类描述：个人修改权限 @创建时间：2019-03-22 13:07:07
	 * @创建人：王俊
	 * @author Administrator
	 *
	 */
	@RequestMapping("pc/admin/modifyAuthority")
	public void modifyAuthority(HttpServletRequest request,HttpServletResponse response) {
		 PersonalAuthority record=new PersonalAuthority();
		 record.setpMainId(request.getParameter("pMainId"));
		 record.setpSubId(request.getParameter("pSubId"));
		 PersonalAuthorityExample example=new PersonalAuthorityExample();
		 com.tszs.entity.PersonalAuthorityExample.Criteria ca=example.createCriteria();
		 ca.andPIdEqualTo(request.getParameter("id"));
		 int i=personalAuthorityBiz.updateByExampleSelective(record, example);
		 if(i>0) {
			 new CallBack().yes(response, "", "success");
		 }else {
			 new CallBack().no(response, "", "修改失败");
		 }
	}
}
 